home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b2.d64
/
heating cost.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
6KB
|
204 lines
50 POKE53280,1:POKE53281,1:PRINT"[144]"
100 RV$="REV#10/15/79-1":GOTO150
110 PRINTL$" YOUR NAME
120 [153]M$" ANYTOWN, N.J. 0ZIP0 "
130 [153]"TEL.#(201)777-7777 "RV$
140 [142]
150 [131]"CEILING",6,"WALLS",8,"FLOORS",7,"MISC.1",7,"WNDWS-1",6,"WNDWS-2",6
160 [131]"DOORS-1",6,"DOORS-2",6,"BG WALLS",5,"BG FLOORS",4,"MISC.1 BG",4,"999"
170 N[178]15
180 [134]A(N),B(N),R(N),RN(N),J(N)
190 [153]"LOAD"[163]9)"HEAT FLOW ANALYSIS":[153]
200 [159]3,3:[159]4,4
210 S$[178][199](29):M$[178][199](30):L$[178][199](31):U$[178][199](15):F$[178][199](14)
220 [133]"NAME-DATE";ND$
230 [153]:[133]"DESIGN TEMP DIFF";T
240 [153]:[133]"DEGREE DAYS";DD
250 [153]:[133]"WINTER UNDERGROUND TEMP";GT
260 [153]: [153]"ENTER OWAIT FOR OIL,EWAIT FOR ELECTRIC"
270 [153]:[153]"OR GWAIT FOR GAS"
280 [161]T$:[139]T$[178]""[167]280
290 [139]T$[178]"O"[176]T$[178]"E"[176]T$[178]"G"[167]310
300 [137]260
310 [139]T$[178]"O"[167] T$[178]"OIL":Q$[178]"/GAL"
320 [139]T$[178]"E"[167] T$[178]"ELECTRIC":Q$[178]"/KWH"
330 [139]T$[178]"G"[167] T$[178]"GAS":Q$[178]"/100 CU FT"
340 [153]:[153]"ENTER THE COST OF "T$Q$
350 [133]M
355 [153]:[133]"SEASONAL HEATING EFFICIENCY(%)";EF
360 [139]T$[178]"OIL"[167] F[178]M[173](140[172]EF[173]100)
370 [139]T$[178]"ELECTRIC"[167] F[178]M[173](3.4[172]EF[173]100)
380 [139]T$[178]"GAS"[167] F[178]M[173](100[172]EF[173]100)
390 [153]:[129]I[178]1[164]4:[135]HF$,J(I):[153]"AREA OF "HF$;:[133]A(I):[153]
400 [139]A(I)[178]0[167]420
410 [153]"R VALUE OF "HF$;:[133]R(I):[153]
420 [130]I
430 [129]I[178]5[164]8:[135]HF$,J(I):[153]"ENTER TOTAL AREA OF "HF$;:[133]A(I):[153]
440 [139]A(I)[178]0[167]480
450 [153]"ENTER 1 FOR SINGLE , 2 FOR STORM ":[153]
460 [153]"OR KNOWN R VALUE OF ";
470 [153]HF$;:[133]R(I):[153]
480 [130]I
490 [129]I[178]11[164]13:[135]HF$,J(I):[153]"TOTAL AREA OF "HF$;:[133]A(I):[153]
500 [139]A(I)[178]0[167]520
510 [153]"R VALUE OF "HF$;:[133]R(I):[153]
520 [130]I
530 [153]"LOAD"
540 [153]"WINDOW AND DOOR INFILTRATION LOSS"
550 [153]"INCLUDED IN R FACTOR";
560 [139]R(5)[179][177]1[175]R(5)[179][177]2 [167]590
570 [139]R(5)[178]1[167]R(5)[178].39
580 [139]R(5)[178]2[167]R(5)[178].86
590 [139]R(6)[179][177]1[175]R(6)[179][177]2 [167]620
600 [139]R(6)[178]1[167]R(6)[178].39
610 [139]R(6)[178]2[167]R(6)[178].86
620 [139]R(7)[179][177]1[175]R(7)[179][177]2 [167]650
630 [139]R(7)[178]1[167]R(7)[178].22
640 [139]R(7)[178]2[167]R(7)[178].75
650 [139]R(8)[179][177]1[175]R(8)[179][177]2 [167]680
660 [139]R(8)[178]1[167]R(8)[178].22
670 [139]R(8)[178]2[167]R(8)[178].75
680 [129]I[178]1[164]8:[139]R(I)[178]0[167]R(I)[178]1
690 B(I)[178][181](T[172]A(I)[173]R(I)):[130]I
700 [129]I[178]11[164]13:[139]R(I)[178]0[167]R(I)[178]1
710 B(I)[178][181]((65[171]GT)[172]A(I)[173]R(I)):[130]I
720 [153]:[137]740
730 [157]4
740 [153]L$" HEAT LOSS"
750 [153][199](30)" R AREA HTM BTUH"
760 [140]
770 [129]I[178]1[164]8:[135]HF$,J(I):[139]A(I)[178]0[167]830
780 [153]M$HF$;
790 I$[178][196](R(I)):J[178]J(I):[141]1380:[153]I$;
800 I$[178][196](A(I)):J[178]7:[141]1380:[153]I$;
810 I$[178][196](.1[172][181](10[172]T[173]R(I)[170].5)):J[178]8:[141]1380:[153]I$;
820 I$[178][196](B(I)):J[178]10:[141]1380:[153]I$
830 [130]I
840 [129]I[178]11[164]13:[135]HF$,J(I):[139]A(I)[178]0[167]920
850 [153]M$HF$;
860 I$[178][196](R(I)):J[178]J(I):[141]1380:[153]I$;
870 [139]I[178]13[167]I$[178][196](A(I)):J[178]7:[141]1380:[153]U$I$F$;:[137]890
880 I$[178][196](A(I)):J[178]7:[141]1380:[153]I$;
890 I$[178][196](.1[172][181](10[172](65[171]GT)[173]R(I)[170].5)):J[178]8:[141]1380:[153]I$;
900 [139]I[178]13[167]I$[178][196](B(I)):J[178]10:[141]1380:[153]U$I$F$:[137]920
910 I$[178][196](B(I)):J[178]10:[141]1380:[153]I$
920 [130]I
930 [153]"TOTALS";
940 A[178]0:[129]I[178]1[164]N:A[178]A[170]A(I):[130]I:I$[178][196](A):J[178]14
950 [141]1380:[153]I$;
960 B[178]0:[129]I[178]1[164]N:B[178]B[170]B(I):[130]I:I$[178][196](B):J[178]18
970 [141]1380:[153]I$
980 Y[178]0:[129]I[178]1[164]8:Y[178]Y[170](A(I)[173]R(I)):[130]I
990 Y[178]Y[172]24[172]DD[173]1000
1000 Y1[178]0:[129]I[178]11[164]13:Y1[178]Y1[170]A(I)[173]R(I):[130]I
1010 Y[178]Y[170]24[172]180[172](65[171]GT)[172]Y1[173]1000
1020 HL[178].1[172][181](.24[172][197](I$)[173]T)
1030 [153]"HEAT LOAD=";HL;M$" KBTU/DD"
1040 [153]"TOTAL BTU/YEAR USED=";[181](.1[172]Y)[172].01;M$" MBTU"
1050 [139]PR$[178]""[167] GU[178][181](Y[173]90):TC[178][181](100[172]F[172]Y)[172].01
1060 HC[178][181](100[172]F[172]Y)[172].01
1070 [153]M$"YEARLY HEAT COST=$";HC
1080 [139]T$[178]"OIL"[176]T$[178]"GAS"[167][153]M$"FOR"U$EF;F$M$"% SEASONAL EFFICIENCY"
1090 [139]T$[178]"OIL"[167][153]M$[181](Y[173]90)M$" GALS OF OIL USED."
1100 SA[178]TC[171]HC
1110 [139][181](SA)[178]0[167]1190
1120 [139]T$[178]"OIL"[175]PR$[179][177]""[167][153]M$[181](GU[171]Y[173]90);M$" GALLONS SAVED"
1130 [153]M$"SAVINGS COMPARED TO ORIGINAL"
1140 [153]"CONDITIONS=$";[181](SA)
1150 [141]2060
1160 [139]PR$[178]"N"[167]1480
1170 [139]PR$[178]"Y"[167]730
1180 [137]1480
1190 [141]2060
1200 [139]PR$[178]"N"[167]1240
1210 [139]PR$[178]"Y"[167]1220
1220 [139]PR[179][178]1[167]1400
1230 [139]PR[177]1[167][157]4:[137]740
1240 [157]3,"TO CHANGE R VALUES TYPE CWAIT, SWAIT TO STOP, RWAIT TO RUN"
1250 [161]C$:[139]C$[178]""[167]1250
1260 [139]C$[179][177]"S"[175]C$[179][177]"C"[175]C$[179][177]"R"[167]1240
1270 [139]C$[178]"S"[167][157]4:[153]:[157]3:[128]
1280 [139]C$[178]"R"[167][153]:[138]
1290 [153]" NEW R VALUES"
1300 [140]
1310 [129]I[178]1[164]8:[135]HF$,J(I):[139]A(I)[178]0[167]1330
1320 [153]"NEW R: "HF$:[133]RN(I):[139]RN(I)[179][177]0[167]R(I)[178]RN(I)
1330 [130]I
1340 [129]I[178]11[164]13:[135]HF$,J(I):[139]A(I)[178]0[167]1360
1350 [153]"NEW R: "HF$:[133]RN(I):[139]RN(I)[179][177]0[167]R(I)[178]RN(I)
1360 [130]I
1370 [137]560
1380 [129]L[178]1[164]J[171][195](I$):[153][199](30);" ";:[130]L:[142]
1390 [153][199](31)"HEAT FLOW ANALYSIS";
1400 [157]4
1410 [141]110
1420 [153]L$"HEAT FLOW ANALYSIS"
1430 [153]M$U$ND$F$
1440 [153]"DESIGN TEMP DIFF,DEG DAYS"U$T;M$DD;F$
1450 [153]M$"BELOW GRADE(BG) GROUND TEMPERATURE"U$GT;F$
1460 [153]M$"ANALYSIS FOR "U$T$" AT"M;M$Q$F$
1470 [137]540
1480 [153]:[133]"COST OF ADDED INSULATION";SC
1490 [153]:[133]"% DOWN PYMT";DP
1500 [139]DP[178]100[167]TM[178]0:[137]1530
1510 [153]:[133]"LOAN INTEREST(%)";LI
1520 [153]:[133]"TERM OF LOAN";TM
1530 [153]:[133]"FUEL INFLATION(%)";FI
1540 [153]:[133]"ANALYZE FOR HOW MANY YEARS";YR
1550 [153]
1560 LI[178]LI[173]100:FI[178]FI[173]100
1570 DP[178]SC[172]DP[173]100
1580 AM[178]SC[171]DP
1590 [143]:PAYBACK CALCULATED IN FOLLOWING 3 LINES
1600 E1[178](1[170]FI)[173](1[170]LI)
1610 F1[178]SC[172](E1[171]1)[173]SA
1620 N1[178][188](F1[170]1)[173][188](E1)
1630 PB[178].1[172][181](10[172]N1[170].5)
1640 [143]:PB=LOG((SC*FI/SA)+1)/LOG(1+FI)
1650 [139]TM[178]0[167]1720
1660 YP[178]AM[172](LI[172](1[170]LI)[174]TM)[173]((1[170]LI)[174]TM[171]1)
1670 [143] YP=YRLY MORTG PYMTS
1680 YP[178].01[172][181](100[172]YP)
1690 N5[178]([188](YP[173]SA)[173][188](1[170]FI))[170]1
1700 N6[178][181](10[172]N5)
1710 [139]N6[173]10[179]0[167]N6[178]0
1720 S4[178]SA[172]((1[170]FI)[174]YR[171]1)[173]FI
1730 [139]YR[177]Y5[167] Y6[178]TM
1740 [139]YR[179][178]TM[167] Y6[178]YR
1750 S6[178]S4[171](YP[172]Y6)
1760 [143]:I=(S/P)^(1/N)-1
1770 R6[178]((S6[173](SC[171]AM))[174](1[173]YR))[171]1
1780 [137]1810
1790 [157]4
1800 [153]M$"FUEL INFL="U$FI[172]100;M$"%:"F$;
1810 [153]M$" PAYBACK="PB;M$" YRS"
1820 [153]M$"THE RATE OF RETURN IS";.1[172][181](1000[172]R6);M$"% FOR"
1830 [153]"$"U$DP;F$M$" DOWN PAYMENT ON $";U$SC;F$M$" OF"
1840 [153]"INSULATION OVER A"U$YR;F$M$" YR PERIOD"
1850 [139]TM[178]0[167]1870
1860 [153]"ASSUMING A"U$LI[172]100;F$M$"% LOAN FOR"U$TM;F$M$" YEARS"
1870 [153]M$"TOTAL SAVINGS AFTER";YR;M$" YEARS $";[181](S4[170].5):[139]TM[178]0[167]1900
1880 [153]M$"TOTAL LOAN PYMTS AFTER";YR;M$" YRS $";[181](YP[172]Y6[170].5)
1890 [153]M$"NET SAVINGS AFTER";YR;M$" YEARS $";[181]((S4[171]YP[172]Y6)[170].5)
1900 [153]M$" AMT LOAN NET"
1910 [153]" YR SAVED PYMTS SAVED"
1920 [129]A[178]1[164]YR:S1[178]SA[172]((1[170]FI)[174](A[171]1))
1930 [139]A[179]10[167][153]" "A;
1940 [139]A[177][178]10[167][153]A;
1950 [139]A[179][178]Y6[167] N9[178][181](S1[171]YP)
1960 [139]A[177]Y6[167] N9[178][181](S1)
1970 I$[178][196]([181](S1)):J[178]8:[141]1380:[153]I$;
1980 [139]A[179][178]Y6[167]I$[178][196]([181](YP[170].5))
1990 [139]A[177]Y6[167]I$[178][196](0)
2000 J[178]12:[141]1380:[153]I$;
2010 I$[178][196](N9):J[178]11:[141]1380:[153]I$
2020 [130]A:[153]
2030 [141]2060
2040 [139]PR$[178]"N"[167]1240
2050 [139]PR$[178]"Y"[167]1790
2060 [139]PR$[178]"Y"[167][157]3:PR$[178]"N":[142]
2070 [153]"TO THE PRINTER? (YWAIT OR NWAIT)
2080 GETPR$:IFPR$=""THEN2080
2090 IFPR$="N"ORPR$="Y"THENRETURN
2100 GOTO2070